# Step 2: 使用官方的 Ubuntu 镜像作为基础运行环境
FROM ubuntu:18.04
# 安装supervisord (rm -rf /var/lib/apt/lists/*为了清楚apt缓存，减少docker体积)
RUN apt-get update && apt-get install -y \
    supervisor \
    wget \
    && rm -rf /var/lib/apt/lists/*

# 安装Golang
RUN wget https://golang.org/dl/go1.21.0.linux-amd64.tar.gz \
    && tar -C /usr/local -xzf go1.21.0.linux-amd64.tar.gz \
    && rm go1.21.0.linux-amd64.tar.gz

# 设置Golang环境变量
ENV PATH="/usr/local/go/bin:${PATH}" \
    GO111MODULE=on \
    GOOS=linux \
    GOARCH=amd64 \
    GOPROXY=https://goproxy.cn,direct

# 复制supervisor文件
COPY ./conf/supervisord.conf /etc/supervisord.conf

# 启动 supervisord
CMD ["supervisord", "-n","-c", "/etc/supervisord.conf"]


